let request = require('./request/')
let InterceptorManager = require('./interceptor/')

function Axios (config) {
    this.defaults = config
    this.interceptors = {
        request: new InterceptorManager(),
        response: new InterceptorManager()
    }
}

// Axiois 原型添加函数
Axios.prototype.request = request
Axios.prototype.get = function (config = {}) {
    return this.request(Object.assign(config, { method: 'GET' }))
}
Axios.prototype.post = function (config = {}) {
    return this.request(Object.assign(config, { method: 'POST' }))
}
// delete, head, options ...

module.exports = Axios